package Metier.Objets;

import java.sql.Timestamp;
import java.util.Date;

public class LotVitrine extends Lot {

    private String nom;

    private Timestamp datePeremption;

    public LotVitrine(int id, String nom, int quantite, Timestamp datePeremption, Produit produit) {
        super(id, quantite, produit);
        this.nom = nom;
        this.datePeremption = datePeremption;
    }

    public LotVitrine(String nom, int quantite, Produit p) {
        super(-1, quantite, p);
        java.util.Date d = new java.util.Date();
        this.nom = nom;
        this.datePeremption = new java.sql.Timestamp(d.getTime() + (p.getDureeVie()*60*60*1000));
    }

    public LotVitrine(Produit p, int quantite, Date date) {
        super(-1, quantite, p);
        this.nom = "";
        this.datePeremption = new Timestamp(date.getTime());
    }

    public Timestamp getDatePeremption() {
        return datePeremption;
    }

    public void setDatePeremption(Timestamp datePeremption) {
        this.datePeremption = datePeremption;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }
}
